#include "singlepageview.h"
#include "ui_singlepageview.h"

SinglePageView::SinglePageView(QWidget *parent) :
    AbstractView(parent),
    m_ui(new Ui::SinglePageView),webView(new QWebView)
{
    m_ui->setupUi(this);

    showStart = 0;
    lineCount = 0;

    mainLayout = new QGridLayout;
    mainLayout->addWidget(webView, 0, 0);
    setLayout(mainLayout);

    webView->load(QUrl("template/welcome.html"));
}

SinglePageView::~SinglePageView()
{
    delete m_ui;
}
void SinglePageView::preview(){

}
void SinglePageView::load(const QString &url){
    TXTBookDataBuilder builder(url);
    builder.parse();
    bookData = builder.getBookData();
    index = 0;
}
void SinglePageView::show(int index){

}
void SinglePageView::showNext(){

}
void SinglePageView::showPrevious(){

}
void SinglePageView::changeEvent(QEvent *e)
{
    QWidget::changeEvent(e);
    switch (e->type()) {
    case QEvent::LanguageChange:
        m_ui->retranslateUi(this);
        break;
    default:
        break;
    }
}
